#include "widget.h"
#include "ui_widget.h"
#include "thread.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
      ui->setupUi(this);
//    Thread thread1;
//    Thread thread2;
//    thread1.start();
//    thread2.start();

//    thread1.wait();
//    thread2.wait();

//    qDebug()<<Thread::num;
    connect(&t,&Thread::startlcd,this,[=](){
        int value=ui->lcdNumber->intValue();
        value--;
        ui->lcdNumber->display(value);
    });

}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    t.start();
}
